# 编译器和标志
GCC = gcc
GPP=g++
CFLAGS = -std=c99 -Wall -Wextra -Wpedantic -O2 -o
GFLAGS=-std=c++11 -Wall -Wextra -Wpedantic -O2 -o
# 源文件和目标文件
# 源文件和目标文件
C_TARGETS = Pro_Block_Wait Pro_Mag Pro_NON_Block_Wait wait_test
CPP_TARGETS = Pro_N_B_W multiprocess 
TARGETS = $(C_TARGETS) $(CPP_TARGETS)

.PHONY: all clean

# 默认编译所有目标
all: $(TARGETS)

# C 文件编译规则
Pro_Block_Wait: Pro_Block_Wait.c
	$(GCC) $(CFLAGS)  $@ $<

Pro_Mag: Pro_Mag.c
	$(GCC) $(CFLAGS)  $@ $<

Pro_NON_Block_Wait: Pro_NON_Block_Wait.c
	$(GCC) $(CFLAGS)  $@ $<

wait_test: wait_test.c
	$(GCC) $(CFLAGS)  $@ $<

# C++ 文件编译规则
Pro_N_B_W: Pro_N_B_W.cpp
	$(GPP) $(GFLAGS)  $@ $<
multiprocess:multiprocess.cpp
	$(GPP) $(GFLAGS)  $@ $<
# 清理生成的文件
clean:
	rm -f $(TARGETS)
